package com.chixing.day18_thread;

public class Consumer implements Runnable{
    private PublicResource publicResource;

    public Consumer(PublicResource publicResource) {
        this.publicResource = publicResource;
    }



    @Override
    public void run() {
        while (true) {
            publicResource.consume();
        }

    }
}
